<?php /* Smarty version 2.6.16, created on 2012-05-01 04:23:11
         compiled from registration_game.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_options', 'registration_game.tpl', 168, false),)), $this); ?>
<?php echo '
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/jQuery.functions.pack.js"></script>
<link rel="stylesheet" href="style/autosuggest.css" type="text/css" />
<script type="text/javascript" src="js/jquery.ausu-autosuggest.min.js"></script>
<script language="javascript" type="text/javascript">
var $ = jQuery.noConflict();
$(document).ready(function(){
	getPageId(\'';  echo $this->_tpl_vars['Formval']['game_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['ladder_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['race_id'];  echo '\',\'';  echo $this->_tpl_vars['Formval']['server_id'];  echo '\');

   $.fn.autosugguest({  
           className: \'ausu-suggest\',
          methodType: \'POST\',
            minChars: 2,
              rtnIDs: true,
            dataFile: \'autocomplete.php?action=populateCity\'
    });

});

function getPageId(type,id,rid,sid)
{	

	$.ajax({
			type:\'POST\',
			url:\'get_game_info.php\',
			data: \'type=\'+type+\'&id=\'+id+\'&rid=\'+rid+\'&sid=\'+sid,
			dataType:\'json\',
			success:function(jData){
			
				if(jData.flag == 1)
				{
					$(\'#ladder_id_td\').html(jData.html);
					$(\'#race_id_td\').html(jData.html1);
					$(\'#server_id_td\').html(jData.html2);
				}
			},
			error: function(XMLHttpRequest, textStatus, errorThrown){
				$(".contactus-block").html("Some server error occoured. Please report to system administrator.</div>");
			}
		});
}
function CheckFields()
{
 
    if(document.getElementById(\'user_type\').value==1)	
	{ 
	   if(!$("#paypal_email_id").emailCheck() || document.getElementById(\'paypal_email_id\').value==\'\' ) 
		   {
				$(\'#FormErrorMsg\').show();
				$(\'#FormErrorMsg\').html("Please Enter a Valid paypal email");
				$("#paypal_email_id").attr(\'style\',\'border:1px solid #FF0000\');
				return false;
		   }
      }
      if(document.getElementById(\'avail_L\').checked == true)
     {
		  if(document.getElementById(\'availability_city\').value==\'\')
		  {
			$(\'#FormErrorMsg\').show();
			$(\'#FormErrorMag\').html("Please enter availability city");
			$(\'#availability_city\').attr(\'style\',\'border:1px solid #FF0000\');
			return false; 
		  }	
		 
      }	  
	  if(document.getElementById(\'game_id\').value==\'\' ) 
	  {
		$(\'#FormErrorMsg\').show();
		$(\'#FormErrorMsg\').html("Please select a game");
		//$(\'#FormFieldCheckErrorMsg\').fadeOut(2000);
		return false;
	 }
  return true;
 }  

 function showhide_div()
{
	
	if(document.getElementById(\'avail_L\').checked == true)
	{  
	  $(\'#avail_city\').show();
	  $(\'#availability_city\').show();
	  
	}
	if(document.getElementById(\'avail_L\').checked == false)
	{  		
	  $(\'#avail_city\').hide();
	  $(\'#availability_city\').hide();
	}  			
} 

function getChangeGame(id)
{
	$.post(\'game_details.php\',{\'game_id\':id, \'action\':\'get_content\'}, function(data){
		$(\'#dynamic_controls\').html(data);
	});
}
  function keyCheck(eventObj, obj)
{
    var keyCode
 
    // Check For Browser Type
    if (document.all){
        keyCode=eventObj.keyCode
    }
    else{
        keyCode=eventObj.which
    }
 
    var str=obj.value
 
    if(keyCode==46){
        if (str.indexOf(".")>0){
            return false
        }
    }
 
    if((keyCode<46 || keyCode >57)   &&   (keyCode >31)){ // Allow only integers and decimal points
        return false
    }
    
    return true
}

function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}
</script>
'; ?>


 <div class="right-panel">
      <div class="findstudent-title"><h1 title="Profile"><span>Registration</span></h1>
        <div class="breadcrumb">Add Game</div>
        <div class="clear"></div>
	  </div>
      <div class="register">
	   <div id='FormErrorMsg' style="color:red; text-align:center; padding-bottom:10px;"><?php if ($this->_tpl_vars['ermsg'] != ''): ?> <?php echo $this->_tpl_vars['ermsg'];  endif; ?> </div>
      <form name="register" id="register" action="" method="post">
	  <input type="hidden" name="user_type" id="user_type" value="<?php echo $this->_tpl_vars['user_type']; ?>
" />
         <fieldset>
		    <?php if ($this->_tpl_vars['user_type'] == '1'): ?>
			<label>Paypal Email ID:</label>
            <input name="paypal_email_id" id="paypal_email_id" type="text" value="<?php echo $this->_tpl_vars['Formval']['paypal_email_id']; ?>
" class="con-req"/>
			<?php endif; ?>
			<label>Availability :</label>
			 <input type="checkbox" name="availability_type1" class='check' value="O" /><label class='chklabel'>Online</label>
			 <input type="checkbox" name="availability_type2" class='check' id="avail_L" onclick="showhide_div()" value="L" /><label class='chklabel'>Local</label>
            <p class="clear"></p>
			
			<label id="avail_city"  <?php if ($this->_tpl_vars['Formval']['availability_type'] == 'L'): ?> <?php else: ?> style='display:none' <?php endif; ?>>City (Local meet-up) :</label>
            <div class="ausu-suggest">
		    <input name="availability_city" id="availability_city" type="text" value="<?php echo $this->_tpl_vars['Formval']['availability_city']; ?>
" class="con-req" autocomplete="off" 
			<?php if ($this->_tpl_vars['Formval']['availability_type'] == 'L'): ?> <?php else: ?> style='display:none' <?php endif; ?>/>
			<input name="cityid" id="cityid" type="hidden"  value="" autocomplete="off" />
			</div>
			
			<div class="clear"></div>
			<div class="clear"></div>
            <p class="clear"></p>
            <label>Select Game :</label>
            <select name="game_id" id="game_id" class="selectbox" onchange="getChangeGame(this.value)">
				<option value="">Select</option>
				<?php echo smarty_function_html_options(array('options' => $this->_tpl_vars['GameArr'],'selected' => $this->_tpl_vars['Formval']['game_id']), $this);?>

			</select>
			<?php if ($this->_tpl_vars['user_type'] == '1'): ?>
            <label>Rate ($):</label>
            <input name="rate" id="rate" type="text" value="<?php echo $this->_tpl_vars['Formval']['rate']; ?>
" onkeypress="return keyCheck(event, this);"/>
			<?php endif; ?>
			<?php if ($this->_tpl_vars['user_type'] == '3'): ?>
		    <label>Peak Hours:</label>
            <input name="peak_hours" id="peak_hours" type="text" value="<?php echo $this->_tpl_vars['Formval']['peak_hours']; ?>
"/>
			<?php endif; ?>
			<p class="clear"></p>
		   
		   <p id="dynamic_controls">
			<!--THE DYNAMIC CONTROL WILL PRINT HERE - PROSENJIT-->
			<?php echo $this->_tpl_vars['extra_content']; ?>

		   </p>
	
			<p class="clear"></p>
            <label>Experience :</label>
            <textarea  name="experience" id="experience"></textarea>
			<?php if ($this->_tpl_vars['user_type'] == '1'): ?>
            <p class="clear"></p>
			<label>Lesson Plan :</label>
            <textarea  name="lesson_plan" id="lesson_plan"></textarea>
			<?php endif; ?>
			<?php if ($this->_tpl_vars['user_type'] == '3'): ?>
            <p class="clear"></p>
			<label>Need Improvement In :</label>
            <textarea  name="need_improvement" id="need_improvement"></textarea>
			<?php endif; ?>
			<p class="clear"></p>
			<label>About Me :</label>
            <textarea  name="description" id="description" onKeyDown="limitText(this.form.description,this.form.countdown,300);"
			onKeyUp="limitText(this.form.description,this.form.countdown,300);"></textarea>
            <p class="clear"></p>
			<label>Characters left </label><input readonly type="text" name="countdown" size="3" value="300" class="tiny">
			<label></label>(Maximum characters: 300)
			<p class="clear"></p>
            <label>&nbsp;</label>
            <input name="submit" class="submit" value="Submit" type="submit" onclick='return CheckFields()' />
            <input name="" class="cancel" value="Cancel" type="reset" />
         </fieldset>
      </form>
      </div>
      
      
      
      <div class="clear"></div>
   </div>